
import java.util.Scanner;

public class Phase2_Driver {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String filename = "test/test1/script.txt";
		/*
		 * if (args.length != 1) {
		 * System.err.println("USAGE: Driver /file/name/to/be.scanned"); return;
		 * } else { filename = args[0]; }
		 */

		for (int i = 1; i < 4; i++) {
			System.out.println("PRINTING RESULTS FOR TEST #"+i);
			System.out.println("#########################################################");
			switch(i){
			case 1:
				filename = "../test/test1/script.txt";
				break;
			case 2:
				filename = "../test/test2/script.txt";
				break;
			case 3:
				filename = "../test/test3/script.txt";
			}
			Parser parser = new Parser(filename);
			System.out.println("\nPRINTING TREE...");
			System.out.println("----------------");
			parser.getTreeHead().printTree();
			System.out.println("----------------");
			System.out.println();

			System.out.println("!!!!!!!!!! BEGIN EVALUATOR !!!!!!!!!!");
			Evaluator evaluator = new Evaluator(parser.getTreeHead());
			System.out.println("!!!!!!!!!!!!!!!! DONE !!!!!!!!!!!!!!!");
			System.out.println("\nSymbol Table:");
			System.out.println("-------------");
			evaluator.printSymbolTable();
			System.out.println("\n\n");
		}
	}

}
